// 按房型查找房源
const express = require('express')
// 引入连接池模块
const pool = require('../pool.js')
const router = express.Router()

// 按房型搜索房源
// http://127.0.0.1:3000/fxfy/3
router.get('/:rtype',(req,res,next) => {
    var obj = req.params
    pool.query('select * from qnls_roomlist where rtype=?',[obj.rtype],(err,r) => {
        if(err){
            return next(err)
        }
        res.send({
            code:200,msg:'查询成功',data:r
        })
    })
})
module.exports = router